package com.ctgu.springshiro.dao;

import com.ctgu.springshiro.entity.Permission;
import org.apache.ibatis.annotations.*;

import java.util.Set;

@Mapper
public interface PermissionDao {
    @Select("select * from permission p " +
            "   left join role_permissions rp " +
            "   on p.id = rp.permission_id where rp.role_id = #{roleId}")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "permissionName", column = "permissionname")
    })
    Set<Permission> getPermissionsByRoleId(int roleId);
}
